<?php
namespace app\admin\controller;
use think\Controller;
use think\Db;
class Returns extends Common
{
	public function index(){
		$all = input('get.all');
		$key = input('get.key');
		$moneys = DB::table('ma_usermoneylog')->alias('a')->join('ma_users b','a.uid = b.uid')->field('b.username,SUM(a.money) as moneys')->where('b.username|a.users','like',"%".$key."%")->order('id desc')->select();
		$moneys = round($moneys[0]['moneys'],2);
		$data = model('Returns')->index();
		$this->assign('all',$all);
		$this->assign('data',$data);
		$this->assign('moneys',$moneys);
		return $this->fetch();
	}
}